package com.iplay.实战java高并发程序设计.chapter6.c64;

import com.iplay.实战java高并发程序设计.chapter6.c62.User;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;

/**
 * @author dangwu
 * @since 2021/11/10 4:54 下午
 */
public class ParallelTest {
    public static void main(String[] args) {
        long s = System.currentTimeMillis();
        IntStream.range(1,1000000).parallel().filter(PrimeUtil::isPrime).count();
        long e = System.currentTimeMillis();
        System.out.println(e-s);

        List<User> ss = new ArrayList<>();
        double asDouble = ss.stream().mapToInt(User::getId).average().getAsDouble();

    }
}
